<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增荣誉专利')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-honor-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">荣誉名称：</label>
                <div class="col-sm-8">
                    <input name="honorName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">电脑端荣誉图片：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="honorImg">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="honorImg" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">移动端荣誉图片：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="honorImgPhone">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="honorImgPhone" name="file" type="file">
                    </div>
                </div>
            </div>
           <!-- <div class="form-group">
                <label class="col-sm-3 control-label is-required">排序 数字自增 倒叙：</label>
                <div class="col-sm-8">
                    <input name="honorSort" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">状态 1启用 0禁用：</label>
                <div class="col-sm-8">
                    <select name="honorState" class="form-control m-b" th:with="type=${@dict.getType('cngj_state')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "cngj/honor"
        $("#form-honor-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-honor-add').serialize());
            }
        }

        $(".file-upload").fileinput({
            uploadUrl: ctx + 'common/uploadOSS',
            maxFileCount: 1,
            autoReplace: true
        }).on('fileuploaded', function (event, data, previewId, index) {
            $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        })
    </script>
</body>
</html>